package com.iee.patterns.example.event_obv.obv_base;

import java.util.List;

/**
 *@ClassName EventMulticaster
 *@Description TODO
 *@Author longxiaonan@163.com
 *@Date 2022/3/23 0023 19:29
 */
public class EventMulticaster {

    private List<AbstractEventListener> listeners;

    public EventMulticaster(List<AbstractEventListener> listeners) {
        this.listeners = listeners;
    }

    public void multicastEvent(Event event){
        for(EventListener listener : listeners){
            listener.onEvent(event);
        }
    }
}
